package com.src;

import com.src.R;

import android.content.Context;
import android.graphics.Canvas;
import android.util.AttributeSet;
import android.view.GestureDetector;
import android.view.Gravity;
import android.widget.ImageView;
import android.widget.LinearLayout;

public class TabButton extends LinearLayout{
	private GestureDetector mGestureDetector;
	private LinearLayout ll;
	private LinearLayout l1;
	private LinearLayout l2;
	private LinearLayout l3;
	private LinearLayout l4;
	public TabButton(Context context, AttributeSet attrs) {
		super(context, attrs);
		ll = new LinearLayout(context);
		l1 = new LinearLayout(context);
		l2 = new LinearLayout(context);
		l3 = new LinearLayout(context);
		l4 = new LinearLayout(context);
		ll.setOrientation(LinearLayout.HORIZONTAL);
		LayoutParams param = 	new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
		ll.setLayoutParams(param);
		LayoutParams param1 = 	new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT,1);
		l1.setGravity(Gravity.CENTER);
		l2.setGravity(Gravity.CENTER);
		l3.setGravity(Gravity.CENTER);
		l4.setGravity(Gravity.CENTER);
		
		LayoutParams paramImage = 	new LayoutParams(50, LayoutParams.WRAP_CONTENT);
		paramImage.gravity = Gravity.CENTER;
		
		param1.weight = 1;
		param1.gravity = Gravity.CENTER;
		ll.addView(l1,param1);
		
		
		//ll.setOrientation(LinearLayout.VERTICAL);
		
		ImageView imageView1 = new ImageView(context);
		l1.addView(imageView1,paramImage);
		imageView1.setBackgroundResource(R.drawable.ccc);
		LayoutParams param2 = 	new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT,1);
		param2.weight = 1;
		param2.gravity = Gravity.CENTER;
		ll.addView(l2,param2);
		
		
		ImageView imageView2 = new ImageView(context);
		l2.addView(imageView2,paramImage);
		imageView2.setBackgroundResource(R.drawable.ccc);
		
		
		LayoutParams param3 = 	new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT,1);
		//param3.weight = 1;
		//param3.gravity = Gravity.CENTER;
		ll.addView(l3,param3);
	
		
		ImageView imageView3 = new ImageView(context);
		l3.addView(imageView3,paramImage);
		imageView3.setBackgroundResource(R.drawable.ccc);
		
		
		LayoutParams param4 = 	new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT,1);
	
		param4.weight = 1;
		param4.gravity = Gravity.CENTER;
		ll.addView(l4,param4);
		ImageView imageView4 = new ImageView(context);
		l4.addView(imageView4,paramImage);
		imageView4.setBackgroundResource(R.drawable.ccc);
		
	    this.addView(ll,new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));
	}

	@Override
	protected void onDraw(Canvas canvas) {
		// TODO Auto-generated method stub
		super.onDraw(canvas);
	}

}
